package com.example.librarymanagement.dto.user;

import com.example.librarymanagement.entity.User;
import com.example.librarymanagement.util.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author ZHB
 */

@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class UserUpdDto extends BaseDto<User> {

    @ApiParam(value = "id", required = true)
    @NotNull
    private Integer id;

    @ApiModelProperty(value = "用户名")
    @NotBlank(message = "用户名不能为空")
    private String username;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "联系电话")
    private String phone;

    @ApiModelProperty(value = "邮箱")
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;

    @ApiModelProperty(value = "状态")
    @NotNull(message = "状态不能为空")
    private Integer state;
}
